package com.zhuangyuan.cloud.data.repository.sqlite;

import com.zhuangyuan.cloud.data.entities.Cart;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface CartRepository extends JpaRepository<Cart,String> {
    @Query("select count(c) from Cart c where c.userId = :userId and c.cate.id = :cateId")
    int findCateCount(@Param("userId") String userId, @Param("cateId") String cateId);
}
